package com.internship.service;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.internship.dao.PracticeChangeDao;
import com.internship.model.PracticeChange;
import com.internship.page.Page;

@Service
public class PracticeChangeService {
	private final int PAGE_SIZE = 10;
	@Autowired
	private PracticeChangeDao practiceChangeDao;

	public Page<PracticeChange> getPracticeChangeList(String studentName,String deptCode,String teacherId,int pageNumber) {
		Page<PracticeChange> page = new Page<PracticeChange>(pageNumber, PAGE_SIZE);
		List<PracticeChange> list = practiceChangeDao.getPracticeChangeList(studentName, deptCode, teacherId,page);
		page.setResultList(list);
		return page;
	}
	public Page<PracticeChange> getMyPracticeChangeList(String studentId,int pageNumber) {
		Page<PracticeChange> page = new Page<PracticeChange>(pageNumber, PAGE_SIZE);
		List<PracticeChange> list = practiceChangeDao.getMyPracticeChangeList(studentId, page);
		page.setResultList(list);
		return page;
	}
	public List<PracticeChange> getPracticeChangeList() {
		List<PracticeChange> list = practiceChangeDao.getPracticeChangeList();
		return list;
	}
	public PracticeChange getPracticeChangeById(int Id) {
		return  practiceChangeDao.getPracticeChangeById(Id);
		
	}
	public int addPracticeChange(PracticeChange practiceChange) {
		return practiceChangeDao.addPracticeChange(practiceChange);
	}
	public int editPracticeChange(PracticeChange practiceChange) {
		return practiceChangeDao.editPracticeChange(practiceChange);
	}
	public int getPracticeChangeCount(String deptCode, String teacherId) {
		return practiceChangeDao.getPracticeChangeCount(deptCode, teacherId);
	}
	public int reviewPracticeChange(PracticeChange practiceChange) {
		return practiceChangeDao.reviewPracticeChange(practiceChange);
	}
}
